package com.vector.demo.controller.admin;

import com.vector.demo.pojo.Lessons;
import com.vector.demo.service.LessonsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * admin 课程管理
 */
@Controller
@RequestMapping("/admin")
public class LessonsManagementController {
    @Autowired
    private LessonsService lessonsService;

    /**
     * 课程管理 Controller
     * @param model
     * @return
     */
    @RequestMapping("/lessonsManagementController")
    public String lessonsManagementController(Model model) {
        List<Lessons> list =  lessonsService.selectAllLessons();
        model.addAttribute("lessonsList",list);
        return "admin/LessonsManagement/lessonsManagement";
    }

    /**
     * 课程 Modify Controller
     * @return
     */
    @RequestMapping("/modifyLessonsManagementController")
    public String modifyLessonsManagementController() {

        return "admin/LessonsManagement/preModifyLessonsManagement";
    }
}

